package tests;

import java.util.Arrays;

import tester.*;
import tester.utilities.Printer;

@Example
public class TestMap {
    
    public TestMap(){}
    
    @TestMethod
    public void testMapping(Tester t){
        int[] i1 = {0, 5, 8};
        int[] i2 = {8, 0, 5};
        DummyClass d1 = new DummyClass();
        DummyClass d2 = new DummyClass();
        d1.setSet(i1);
        d2.setSet(i2);
        t.checkExpect(d1, d2);
        System.out.println("Foo" + Printer.produceString(d1));
        
    }
    
    public static void main(String[] args){
        Tester.runFullReport(new TestMap());
    }
    
}

class DummyClass{
    
    @EqualityMap(Map.class)
    int[] unsortedSet;
    
    
    public DummyClass(){}
    
    public void setSet(int[] array){
        unsortedSet = array;
    }
    
}

class Map implements MapFunction<int[], int[]>{
  
    public int[] map(int[] t) {
        int[] returnVal = t.clone();
        Arrays.sort(returnVal);
        return returnVal;
    }
    
}
